<div class="hbox hbox-auto-xs hbox-auto-sm" ng-init="
    app.settings.asideFolded = false; 
    app.settings.asideDock = false;
  ">
	<!-- main -->
	<div class="wrapper-md">
		<div class="panel panel-default">
			<div class="panel-heading">

				<form class="form-search">
					<label for="name" has-permission="infoAuthFind">资源名称：</label> <input id="name" type="text" ng-model="vm.infoAuth.name" class="input-medium search-query" >
					<button type="submit" class="btn btn-primary button_modify" style="margin-left: 20px;" ng-click="queryList()" >搜索</button>
					<button class="btn btn-success button_modify" style="float:right"  data-toggle="modal" data-target="#addAuthModal" ng-click="intiAddRole()" >增资源</button>
				</form>
			</div>
		</div>

		<div class="table-responsive">
			<table id="authTable"></table>
		</div>
	</div>
	
	<!--
    	作者：dabing9
    	时间：2017-10-26
    	描述：rights模态框
    -->

	<div class="modal fade" id="addAuthModal" tabindex="-1" data-keyboard="false" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"  ng-click="close()">&times;</span></button>
					<h4 class="modal-title" id="myModalLabel">资源添加</h4>
				</div>

				<div class="modal-body">

					<form class="form-horizontal" ng-submit="add()" role="form" name="form">
						<input type="hidden" ng-model="vm.editInfoAuth.id" >
						<div class="form-group">
							<label for="authName" class="col-sm-3 control-label">资源名称：</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" id="authName" ng-model="vm.editInfoAuth.authName" required>
							</div>
						</div>
						<div class="form-group" style="margin-top: 10px;">
							<label for="authCode" class="col-sm-3 control-label">资源代码：</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" id="authCode" ng-model="vm.editInfoAuth.authCode" required>
							</div>
						</div>
						<div class="form-group">
							<label  class="col-sm-3 control-label">资源类型：</label>
							<div class="col-sm-9">
								<label class="checkbox-inline">
									<input type="radio" name="type" id="optionsRadios1" value="1" ng-model="vm.editInfoAuth.authType" ng-checked = "true" ng-click="chooseType(vm.editInfoAuth.authType)"/>目录
								</label>
								<label class="checkbox-inline">
									<input type="radio" name="type" id="optionsRadios2" value="2" ng-model="vm.editInfoAuth.authType" ng-click="chooseType(vm.editInfoAuth.authType)">菜单
								</label>
								<label class="checkbox-inline">
									<input type="radio" name="type" id="optionsRadios3" value="3" ng-model="vm.editInfoAuth.authType" ng-click="chooseType(vm.editInfoAuth.authType)">按钮
								</label>
							</div>
						</div>
						<div class="form-group" ng-show = "vm.parentShow">
							<label  class="col-sm-3 control-label">所属父类：</label>
							<div class="col-sm-9">
								<table class="auth_table" >
									<thead class="auth_thead">
										<tr>
											<td >#</td>
											<td >名称</td>
										</tr>
									</thead>
									<tbody class="auth_tbody">
										<tr ng-repeat="auth in vm.auths" ng-class="{tr_light: vm.selectAuth.id == auth.id}" ng-click="selectParentAuth(auth);">
											<td  style="width:50%;" ng-bind="$index+1"></td>
											<td  ng-bind="auth.authName"></td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>

						<div class="form-group" style="margin-top: 10px;">
							<label for="authUri" class="col-sm-3 control-label">资源地址：</label>
							<div class="col-sm-4">
								<input type="text" class="form-control" id="authUri" ng-model="vm.editInfoAuth.authUrl" required>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">资源描述：</label>
							<div class="col-sm-6">
								<textarea class="form-control" rows="3" ng-model="vm.editInfoAuth.remark" required></textarea>
							</div>
						</div>
					</form>

				</div>
				<div class="modal-footer">
					<button type="submit" class="col-sm-2 btn btn-primary"
							style="margin-left: 40%;"
							ng-click="add()">
						保存
					</button>
				</div>
			</div>
		</div>
	</div>
</div>